/*
 * Notification widget of Lukija RiL client.
 *
 * @author Yves Marcoz
 *
 * Copyright(C) 2011 Yves Marcoz <yvez@marcoz.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import Qt 4.7

Rectangle {

    height: 86
    gradient: Gradient {
        GradientStop {
            position: 0
            color: "#ffffff"
        }

        GradientStop {
            position: 0
            color: "#fbfbc5"
        }

        GradientStop {
            position: 1
            color: "#fbf846"
        }
    }
    width: parent.width
    y: 86
    z: 10
    opacity: 0

    function showNotification(text) {
        message = text;
        state="visible";
        timer.start()
    }

    Timer {
        id: timer
        interval: 2500; running: false; repeat: false
        onTriggered: state="";
    }

    id: rectangle1
    property string message: ""

    Text {
        text: parent.message
        horizontalAlignment: Text.AlignHCenter
        anchors.centerIn: parent
        font.bold: true;
    }

    states: State { name: "visible"
        PropertyChanges { target: rectangle1; opacity: 1; }
    }

    transitions: Transition {
            NumberAnimation {
                properties: "opacity"
                duration: 300
                easing.type: Easing.InQuart
            }
    }

}
